using System;
namespace ch.ethz.ssh2
{
	
	/// <summary> A <code>ConnectionMonitor</code> is used to get notified when the
	/// underlying socket of a connection is closed. 
	/// 
	/// </summary>
	/// <author>  Christian Plattner
	/// </author>
	/// <version>  2.50, 03/15/10
	/// </version>
	
	public interface ConnectionMonitor
	{
		/// <summary> This method is called after the connection's underlying
		/// socket has been closed. E.g., due to the {@link Connection#close()} request of the
		/// user, if the peer closed the connection, due to a fatal error during connect()
		/// (also if the socket cannot be established) or if a fatal error occured on
		/// an established connection.
		/// <p>
		/// This is an experimental feature.
		/// <p>
		/// You MUST NOT make any assumption about the thread that invokes this method.
		/// <p>
		/// <b>Please note: if the connection is not connected (e.g., there was no successful
		/// connect() call), then the invocation of {@link Connection#close()} will NOT trigger
		/// this method.</b>
		/// 
		/// </summary>
		/// <seealso cref="Connection.addConnectionMonitor(ConnectionMonitor)">
		/// 
		/// </seealso>
		/// <param name="reason">Includes an indication why the socket was closed.
		/// </param>
		//UPGRADE_NOTE: Exception 'java.lang.Throwable' was converted to 'System.Exception' which has different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1100'"
		void  connectionLost(System.Exception reason);
	}
}